# while循环
i=5
while i>0:
    print(i)
    i-=1
    pass

# 将猜拳游戏改进，可以不限制一直玩
import random
while True:
    computer = random.randint(0, 2)  # randint方法，随机生成数字，括号内可以指定数字范围
    user = int(input("请出拳 【0：石头  1：剪刀  2：布】 "))
    if (user == 0 and computer == 2) or (user == 1 and computer == 0) or (user == 2 and computer == 1):
        print("电脑出拳为：{}，用户出拳为：{}，很遗憾，您输了".format(computer, user))
        pass
    elif (user == 0 and computer == 1) or (user == 1 and computer == 2) or (user == 2 and computer == 0):
        print("电脑出拳为：{}，用户出拳为：{}，恭喜您赢了".format(computer, user))
        pass
    else:
        print("电脑出拳为：{}，用户出拳为：{}，平局了，一样厉害".format(computer, user))
        pass